<?php

/**
 * rmPlannedOut form base class.
 *
 * @method rmPlannedOut getObject() Returns the current form's model object
 *
 * @package    ressourceManager
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasermPlannedOutForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_planned_out' => new sfWidgetFormInputHidden(),
      'id_out_type'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('idOutType'), 'add_empty' => false)),
      'id_user'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('idUser'), 'add_empty' => false)),
      'out_day'        => new sfWidgetFormDate(),
      'out_slot'       => new sfWidgetFormChoice(array('choices' => array('am' => 'am', 'pm' => 'pm', 'all' => 'all'))),
    ));

    $this->setValidators(array(
      'id_planned_out' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_planned_out')), 'empty_value' => $this->getObject()->get('id_planned_out'), 'required' => false)),
      'id_out_type'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('idOutType'))),
      'id_user'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('idUser'))),
      'out_day'        => new sfValidatorDate(array('required' => false)),
      'out_slot'       => new sfValidatorChoice(array('choices' => array(0 => 'am', 1 => 'pm', 2 => 'all'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('rm_planned_out[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'rmPlannedOut';
  }

}
